import {createRouter, createWebHashHistory} from "vue-router";
import {routes} from "./basic.ts";
import {changeTitle} from "../hooks/utils/changeTitle.ts";

const router = createRouter({
    history: createWebHashHistory(),
    routes: routes
})
router.beforeEach((to,
                   _, next) => {
    /* 路由发生变化修改页面title */
    if (to.meta.title) {
        changeTitle(to.meta.title as string)
    }
    next();
});
export default router